﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/Layouts/Admin.Master" AutoEventWireup="true"
    CodeBehind="ViewCart.aspx.cs" Inherits="MLM.AdminCP.Pages.ViewCart" meta:resourcekey="PageResource1" %>

<%@ Import Namespace="MLM.AdminCP" %>
<%@ Import Namespace="MLM.AdminCP.Class" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div class="CartView">
        <%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>--%>
        <div class="FillterProduct" style="margin: 10px;">

            <telerik:RadComboBox CssClass="rancombox2" runat="server" ID="RabShippingfree" DataTextField="Name"
                DataValueField="ShippingId" DataSourceID="ShippingfreeEds" AutoPostBack="True"
                EnableLoadOnDemand="True" Label="Select Shipping:" meta:resourcekey="RabCountryResource1">
                <HeaderTemplate>
                    <ul>
                        <li style="list-style-type: none" class="col1">
                            <asp:Label ID="lbCountry" runat="server" Text="Shipping"></asp:Label></li>
                    </ul>
                </HeaderTemplate>
            </telerik:RadComboBox>

        </div>
        <asp:GridView runat="server" ID="gvShoppingCart" AutoGenerateColumns="False" EmptyDataText="Shopping cart empty product"
            Width="100%" CellPadding="4" ShowFooter="True" DataKeyNames="ProductId" OnRowDataBound="gvShoppingCart_RowDataBound"
            OnRowCommand="gvShoppingCart_RowCommand" BackColor="White" BorderColor="#8D8155"
            BorderStyle="None" BorderWidth="1px" ForeColor="Black" GridLines="Vertical" meta:resourcekey="gvShoppingCartResource1">
            <HeaderStyle HorizontalAlign="Left" BackColor="#E9EAEF" ForeColor="Black" Font-Bold="True"
                Height="40px" />
            <FooterStyle HorizontalAlign="Right" BackColor="#CCCC99" />
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="STT" meta:resourcekey="TemplateFieldResource1">
                    <ItemTemplate>
                        <div style="padding: 5px;">
                            <%# Container.DataItemIndex + 1 %>
                        </div>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Name" HeaderText="Product Name" meta:resourcekey="BoundFieldResource1" />
                <asp:TemplateField HeaderText="Count" meta:resourcekey="TemplateFieldResource2">
                    <ItemTemplate>
                        <asp:TextBox runat="server" ID="txtQuantity" Columns="5" Text='<%# Eval("Quantity") %>'
                            meta:resourcekey="txtQuantityResource1"></asp:TextBox><br />
                        <asp:LinkButton runat="server" ID="btnRemove" Text="Remove" CommandName="Remove"
                            CommandArgument='<%# Eval("ProductId") %>' Style="font-size: 12px;" meta:resourcekey="btnRemoveResource1"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="UnitPrice" HeaderText="Price" meta:resourcekey="BoundFieldResource2">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>
                <%--<asp:TemplateField HeaderText="Price" meta:resourcekey="BoundFieldResource2">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                    <ItemTemplate>
                        <%#NumberUtil.Round(PriceUtil.FormatPrice(Eval("UnitPrice"),0,dtct,int.Parse(Permission.GetCurrentRole().ToString()),Eval("ProductId"),PriceUtil.GetCountry(dtct,Permission.GetCurrentUserId())))%>
                    </ItemTemplate>
                </asp:TemplateField>--%>
                <%-- <asp:BoundField DataField="PriceWithTax" HeaderText="Price with out tax">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>--%>
                <%--   <asp:BoundField DataField="Points" HeaderText="Points (PV)">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>--%>
                <asp:BoundField DataField="VAT" HeaderText="VAT (%)" meta:resourcekey="BoundFieldResource4">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>
                <%--<asp:BoundField DataField="PointsTotal" HeaderText="Total Points (PV)">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>--%>
                <asp:TemplateField HeaderText="Total Price" meta:resourcekey="BoundFieldResource5">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                    <ItemTemplate>
                        <%--<%#NumberUtil.Round(PriceUtil.FormatPrice(Eval("UnitPrice"),-1,dtct,int.Parse(Permission.GetCurrentRole().ToString()),Eval("ProductId"),PriceUtil.GetCountry(dtct,Permission.GetCurrentUserId()))*long.Parse(Eval("Quantity").ToString()))%>--%>
                        <%#Eval("TotalPrice") %>
                    </ItemTemplate>
                </asp:TemplateField>
                <%-- <asp:BoundField DataField="TotalPrice" HeaderText="Total Price">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>--%>
                <%--<asp:BoundField DataField="TotalPriceTax" HeaderText="Total Price With Tax">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                </asp:BoundField>--%>
                <asp:TemplateField HeaderText="Total Price" meta:resourcekey="BoundFieldResource5">
                    <HeaderStyle HorizontalAlign="Right" />
                    <ItemStyle HorizontalAlign="Right" />
                    <ItemTemplate>
                        <%#NumberUtil.Round(PriceUtil.FormatPrice(Eval("UnitPrice"),-1,dtct,int.Parse(Permission.GetCurrentRole().ToString()),Eval("ProductId"),PriceUtil.GetCountry(dtct,Permission.GetCurrentUserId()))*long.Parse(Eval("Quantity").ToString()))%>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <RowStyle BackColor="#F7F7DE" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
        <%--     </ContentTemplate>
        </asp:UpdatePanel>--%>
        <br />
        <asp:Button runat="server" ID="btnUpdateCart" Text="Update to cart" OnClick="btnUpdateCart_Click"
            CssClass="button" meta:resourcekey="btnUpdateCartResource1" />
        <asp:Button runat="server" ID="btnPayMentCart" Text="Cart Out" CssClass="button"
            meta:resourcekey="btnPayMentCartResource1" />
    </div>
    <asp:EntityDataSource ID="ShippingfreeEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableDelete="True" EnableFlattening="False"
        EnableInsert="True" EnableUpdate="True" EntitySetName="ShippingFees">
    </asp:EntityDataSource>
</asp:Content>
